package com.weirong.smartvault.backservice.util.statistics;

import com.weirong.smartvault.common.tools.spring.context.PropertyUtil;
import com.weirong.smartvault.entity.StatisticsData;

/**
 * 于2017/12/22由 KFEB4 创建 .
 */
public class StatisticsCheckAvailable {
    public static final String FunctionName = "check";
    public static Boolean checkProperty() {
        String type = PropertyUtil.getProperty("com.weirong.smartvault.statistics.historyCheck");
        switch (type) {
            case "0":
                return true;
            case "1":
                return null;
            default:
                return false;
        }
    }
    static class stockHistory {
        public static boolean check(StatisticsData data, String currencyType, Integer year, Integer month) {
            //检查统计数据是否有效
            Boolean pro = checkProperty();
            if (pro == null)
                return true;//在这里做检查
            return pro;
        }

        public static boolean check(StatisticsData data, String currencyType, Integer year, Integer month, Integer day) {
            //检查统计数据是否有效
            Boolean pro = checkProperty();
            if (pro == null)
                return true;//在这里做检查
            return pro;
        }
    }

    public static class use{
        public static boolean check(StatisticsData data, String currencyType, Integer year, Integer month){
            Boolean pro = checkProperty();
            if (pro == null)
                return true;//在这里做检查
            return pro;
        }
        public static boolean check(StatisticsData data, String currencyType, Integer year, Integer month,Integer day){
            Boolean pro = checkProperty();
            if (pro == null)
                return true;//在这里做检查
            return pro;
        }
    }
}
